import java.util.Scanner;

public class BinarySequence {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int j = n;
        int o = n;
        int i = 0;
        while(i < 16) {
            System.out.print(j&1);
            j >>= 2;
            i++;
        }
        System.out.println();
        o >>= 1;
        i = 0;
        while(i < 16) {
            System.out.print(o&1);
            o >>= 2;
            i++;
        }

    }
}
